feat: add webhook event for content delivery publish completion - #3757
feat: add webhook event for content delivery publish completion#3757dkrizan wants to merge 16 commits into
Conversation
…hooks on eventTypes
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This PR is stale because it has been open for 30 days with no activity. |
|
This PR was closed because it has been inactive for 14 days since being marked as stale. |
Summary
Emits a new
CONTENT_DELIVERY_PUBLISHwebhook event when a content delivery publish completes, so consumers can react to translations being available on storage without polling or implementing their own debouncing.WebhookEventType.CONTENT_DELIVERY_PUBLISH+ payload DTO (ContentDeliveryPublishWebhookData) carried onWebhookRequest.contentDeliveryConfig.eventTypesset onWebhookConfig(jsonb). Existing webhooks are backfilled to["PROJECT_ACTIVITY"], so their behaviour is unchanged. Exposed in the EE webhook config API and the webapp webhook form.ContentDeliveryUploader.upload()publishes a SpringOnContentDeliveryPublishedevent (a value snapshot) — covering both manual and automated publishes.@TransactionalEventListener(AFTER_COMMIT)finds project webhooks subscribed to the event and enqueues oneWEBHOOK_DISPATCHbatch job per webhook.WebhookDeliveryManager, so signing, retry, failure-streak tracking and auto-disable behave identically.WebhookProcessornow only fires activity webhooks for webhooks subscribed toPROJECT_ACTIVITY.Payload
{ "webhookConfigId": 123, "projectId": 10, "eventType": "CONTENT_DELIVERY_PUBLISH", "activityData": null, "contentDeliveryConfig": { "projectId": 10, "id": 55, "name": "Production CDN", "slug": "abc123", "lastPublished": 1718539200000, "files": ["en.json", "de.json"] } }Notes
WebhookConfig.eventTypesis intentionally@ActivityIgnoredProp: logging it would emit a WebhookConfig activity on every save, which re-triggers the webhook automation and recursively fires webhooks (caught and fixed during review; covered by a regression test).@Schemaannotations. Docs update is a follow-up.Test plan
:data—WebhookConfigEventTypesTest(jsonb persistence),ContentDeliveryUploaderTest(event emission):ee-test—WebhookAutomationTest(5/5, incl. opt-out + unchanged activity behaviour),WebhookConfigControllerTest(13/13, incl. eventTypes create/default),ContentDeliveryPublishWebhookTest(dispatch + payload, event-type filtering, failure-streak)eslint+tscCloses #3616